home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / gs261ini.zip / LANGUAGE.DOC < prev    next >
Text File  |  1993-05-27  |  16KB  |  421 lines

  1.    Copyright (C) 1989-1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.
  18.  
  19. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  20.  
  21. This file, language.doc, describes the Ghostscript language.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.
  25.  
  26. The Ghostscript interpreter, except as noted below, is intended to execute
  27. properly any source program written in a language defined by reference to
  28. the December 1990 printing of the PostScript Language Reference Manual
  29. (Second Edition) published by Addison-Wesley (ISBN 0-201-18127-4).  The
  30. Ghostscript language includes the following elements of the PostScript
  31. (TM) language:
  32.  
  33.     - The full PostScript Level 1 language, as also defined in the
  34. first edition of the PostScript Language Reference Manual, ISBN
  35. 0-201-10174-2, Addison-Wesley, 1985.
  36.  
  37.     - The CMYK color, file system, version 25.0 language, and
  38. miscellaneous additions listed in sections A.1.4, A.1.6, A.1.7, and
  39. A.1.8 of the Second Edition respectively, including allowing a string
  40. operand for the 'status' operator;
  41.  
  42.     - The Display PostScript extensions listed in section A.1.3
  43. of the Second Edition, but excluding the operators listed in section
  44. A.1.2.  These facilities are only available if the dps feature or the
  45. level2 feature was selected at the time that Ghostscript was compiled
  46. and linked.
  47.  
  48.     - The composite font extensions listed in section A.1.5 of
  49. the Second Edition, but not the ability to handle Type 0 fonts.
  50. These facilities are only available if the compfont feature or the
  51. level2 feature was selected at the time that Ghostscript was compiled
  52. and linked.
  53.  
  54.     - A subset of the other PostScript Level 2 operators and
  55. facilities listed in section A.1.1 of the Second Edition, identified
  56. below.  These facilities are only available if the level2 feature was
  57. selected at the time that Ghostscript was compiled and linked.
  58.  
  59. Ghostscript also includes a number of operators defined below that are not
  60. in the PostScript language.
  61.  
  62. Stub facilities
  63. ---------------
  64.  
  65. The following operators, while provided in the current release, have only
  66. a partial or dummy implementation.
  67.  
  68. Form and pattern operators:
  69.     execform
  70.  
  71. Graphics state operators:
  72.     currentblackgeneration, currentcolorscreen,
  73.     currenthalftonephase, currentundercolorremoval,
  74.     setblackgeneration, setcolorscreen,
  75.     sethalftonephase, setundercolorremoval,
  76.     currenthalftone, sethalftone
  77.  
  78. Interpreter parameter operators:
  79.     currentsystemparams, currentuserparams
  80.     setsystemparams, setucacheparams, setuserparams
  81.     ucachestatus
  82.  
  83. Path construction operators:
  84.     ucache
  85.  
  86. Virtual memory operators:
  87.     currentshared, scheck, setshared, setvmthreshold, shareddict,
  88.     SharedFontDirectory, vmreclaim
  89.  
  90. Miscellaneous operators:
  91.     serialnumber
  92.  
  93. Unclassified Level 2 operators
  94. ------------------------------
  95.  
  96. Ghostscript provides the following PostScript Level 2 operators
  97. listed in section A.1.1 of the Second Edition and not listed in any
  98. of the other A.1 sections.
  99.  
  100. File operators:
  101.        filter (all but DCTEncode/Decode)
  102.  
  103. Resource operators:
  104.     defineresource, findresource, resourceforall, resourcestatus,
  105.     undefineresource
  106.  
  107. Character and font operators:
  108.     cshow, xshow, yshow, xyshow
  109.     glyphshow
  110.     findencoding, rootfont, setcachedevice2
  111.       (WMode is supported, but composite fonts are not)
  112.  
  113. Graphics state operators:
  114.     currentcolor, currentcolorspace, setcolor, setcolorspace
  115.       (except for Indexed with procedure, true Separation, and Pattern)
  116.     currentcolorrendering, setcolorrendering
  117.  
  118. Miscellaneous operators:
  119.     languagelevel
  120.  
  121. In addition, Ghostscript supports the following Level 2 facilities:
  122.  
  123.     - Use of a dictionary with the image and imagemask operators;
  124.  
  125.     - Use of a string or a file as data source with the image,
  126.     imagemask, and colorimage operators.
  127.  
  128. When the Level 2 features are present, Ghostscript also supports the
  129. following operator:
  130.  
  131.     <1 or 2> .setlanguagelevel -
  132.         Set the current language level to Level 1 or Level 2.
  133.           When the language level is 1, no Level 2 facilities
  134.           are provided.
  135.  
  136. Unimplemented Level 2 facilities
  137. --------------------------------
  138.  
  139. Ghostscript currently does not implement the following Level 2
  140. operators and variables:
  141.     currentdevparams, setdevparams
  142.     GlobalFontDirectory
  143.     makepattern
  144.     realtime
  145.     currentpagedevice, setpagedevice
  146.     startjob
  147.  
  148. Ghostscript currently does not implement the following Level 2
  149. facilities not enumerated above:
  150.     garbage collection
  151.     global and local VM
  152.     page devices
  153.     job control
  154.     halftone dictionaries
  155.     user names
  156.  
  157. Ghostscript-specific additions
  158. ==============================
  159.  
  160. Miscellaneous
  161. -------------
  162.  
  163. ^Z is counted as whitespace.
  164.  
  165. run can take either a string or a file as its argument.  In the former
  166. case, it uses findlibfile to open the file (searching directories as
  167. needed).  In the latter case, it just runs the file, closing it at the
  168. end, and trapping errors just as for the string case.
  169.  
  170. Mathematical operators
  171. ----------------------
  172.  
  173.     <number> arccos <number>
  174.         Computes the arc cosine of a number between -1 and 1.
  175.  
  176.     <number> arcsin <number>
  177.         Computes the arc sine of a number between -1 and 1.
  178.  
  179. String operators
  180. ----------------
  181.  
  182.     <state> <fromString> <toString> type1encrypt <newState> <toSubstring>
  183.         Encrypts fromString according to the algorithm for Adobe
  184.           Type 1 fonts, writing the result into toString.
  185.           toString must be at least as long as fromString or a
  186.           rangecheck error occurs.  state is the initial state of
  187.           the encryption algorithm (a 16-bit non-negative
  188.           integer); newState is the new state of the algorithm.
  189.  
  190.     <state> <fromString> <toString> type1decrypt <newState> <toSubstring>
  191.         Decrypts fromString according to the algorithm for Adobe
  192.           Type 1 fonts, writing the result into toString.  Other
  193.           specifications are as for type1encrypt.
  194.  
  195. Relational operators
  196. --------------------
  197.  
  198.     <number|string> <number|string> max <number|string>
  199.         Returns the larger of two numbers or strings.
  200.  
  201.     <number|string> <number|string> min <number|string>
  202.         Returns the smaller of two numbers or strings.
  203.  
  204. File operators
  205. --------------
  206.  
  207.     <string> findlibfile <foundstring> <file> true or <string> false
  208.         Opens the file of the given name for reading.  If the file
  209.           cannot be opened using the supplied name, searches
  210.           through directories as described in use.doc.  If the
  211.           search fails, findlibfile simply pushes false on the
  212.           stack and returns, rather than causing an error.
  213.  
  214.     <file> <integer> unread -
  215.          Pushes back the last-read character onto the front of the
  216.           file.  If the file is only open for writing, or if the
  217.           integer argument is not the same as the last character
  218.           read from the file, causes an ioerror error.  May also
  219.           cause an ioerror if the last operation on the file was not
  220.           a reading operation.
  221.  
  222.     <file> <device> writeppmfile -
  223.         Writes the contents of the device, which must be an image
  224.           device, onto the file, in Portable PixMap (ppm) format.
  225.           Does not close the file.
  226.  
  227. Path operators
  228. --------------
  229.  
  230.     <x> <y> <width> <height> rectappend -
  231.     <numarray> rectappend -
  232.     <numstring> rectappend -
  233.         Appends a rectangle or rectangles to the current path, in
  234.           the same manner as rectfill, rectclip, etc.  Onl